<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>VueJS</title>
</head>
<body>
    <div id="app">
        <h1>任务列表</h1>
        <input type="text" v-model="form.text">
        <button onclick="addArticle()">发表</button>
        <hr>
        <ul>
            <li v-for="a in form.articles">{{a}}</li>
            
        </ul>
    </div>
    
    
</body>
<script src="../lib/font/vue.min.js"></script>
<script>

    //1.创建VUE实例对象
   
    let form = {
        text:'',
        articles : ["张三","李四"]

    };
    function addArticle(){
        form.articles.push(form.text);
        form.text = ""
    }

    let wm = new Vue({
        el:"#app",
        data:{
            form:form,
        }
    })




</script>
</html>